package com.example.demo.model.page;

import lombok.Data;

import java.util.List;

/**
 * 2025/9/30
 */
@Data
public class PageResult<T> {
    private long total;
    private List<T> records;
    private int pageNum;
    private int pageSize;
    private int pages;

    public PageResult(long total, List<T> records, int pageNum, int pageSize) {
        this.total = total;
        this.records = records;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.pages = (int)(total + pageNum -1) / pageNum;
    }
}
